<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>QJson: QJson Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QJson
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#signals">Signals</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">QJson Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Main class used to convert JSON data to QVariant objects.  
 <a href="class_q_json.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qjson_8h_source.html">qjson.h</a>&gt;</code></p>

<p><a href="class_q_json-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json_1_1_serializer_runnable.html">SerializerRunnable</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convenience class for converting JSON data to QVariant objects using a dedicated thread.  <a href="class_q_json_1_1_serializer_runnable.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="signals"></a>
Signals</h2></td></tr>
<tr class="memitem:a41fe00aacdd1be619fdcb64b3bf0d418"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a41fe00aacdd1be619fdcb64b3bf0d418"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>error</b> (int line, QString message)</td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a61000830a25ad1a5e0096e88a523f067"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a61000830a25ad1a5e0096e88a523f067"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>QJson</b> (QObject *parent=0)</td></tr>
<tr class="memitem:a9bc6ed3d63283e1c654f42f1906468b1"><td class="memItemLeft" align="right" valign="top">QVariant&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json.html#a9bc6ed3d63283e1c654f42f1906468b1">parse</a> (QIODevice *io, bool *ok=0)</td></tr>
<tr class="memitem:af94d110ccf57aa800a528bee19561dad"><td class="memItemLeft" align="right" valign="top">Q_INVOKABLE QVariant&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json.html#af94d110ccf57aa800a528bee19561dad">parse</a> (const QByteArray &amp;jsonData, bool *ok=0)</td></tr>
<tr class="memitem:abcbd4e2d7d22ab5dcc07c7883be8ad72"><td class="memItemLeft" align="right" valign="top">Q_INVOKABLE QVariant&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json.html#abcbd4e2d7d22ab5dcc07c7883be8ad72">parse</a> (const QUrl url, bool *ok=0)</td></tr>
<tr class="memitem:a3386d3a47cf4ca73224aad37e23d28a5"><td class="memItemLeft" align="right" valign="top">QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json.html#a3386d3a47cf4ca73224aad37e23d28a5">errorString</a> () const </td></tr>
<tr class="memitem:a62611c70f740caf8cdddd71dcf85ebf0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_json.html#a62611c70f740caf8cdddd71dcf85ebf0">errorLine</a> () const </td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Main class used to convert JSON data to QVariant objects. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a62611c70f740caf8cdddd71dcf85ebf0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_q_json.html#a62611c70f740caf8cdddd71dcf85ebf0">QJson::errorLine</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This method returns line number where the error occurred </p>
<dl class="section return"><dt>Returns:</dt><dd>the line number where the error occurred </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="class_q_json.html#a3386d3a47cf4ca73224aad37e23d28a5">errorString</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a3386d3a47cf4ca73224aad37e23d28a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QString <a class="el" href="class_q_json.html#a3386d3a47cf4ca73224aad37e23d28a5">QJson::errorString</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This method returns the error message </p>
<dl class="section return"><dt>Returns:</dt><dd>a QString object containing the error message of the last parse operation </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="class_q_json.html#a62611c70f740caf8cdddd71dcf85ebf0">errorLine</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a9bc6ed3d63283e1c654f42f1906468b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QVariant <a class="el" href="class_q_json.html#a9bc6ed3d63283e1c654f42f1906468b1">QJson::parse</a> </td>
          <td>(</td>
          <td class="paramtype">QIODevice *&#160;</td>
          <td class="paramname"><em>io</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read JSON string from the I/O Device and converts it to a QVariant object </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">io</td><td>Input output device </td></tr>
    <tr><td class="paramname">ok</td><td>if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>a QVariant object generated from the JSON string </dd></dl>

</div>
</div>
<a class="anchor" id="af94d110ccf57aa800a528bee19561dad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QVariant <a class="el" href="class_q_json.html#a9bc6ed3d63283e1c654f42f1906468b1">QJson::parse</a> </td>
          <td>(</td>
          <td class="paramtype">const QByteArray &amp;&#160;</td>
          <td class="paramname"><em>jsonData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This is a method provided for convenience. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">jsonData</td><td>data containing the JSON object representation </td></tr>
    <tr><td class="paramname">ok</td><td>if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>a QVariant object generated from the JSON string </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="class_q_json.html#a3386d3a47cf4ca73224aad37e23d28a5">errorString</a> </dd>
<dd>
<a class="el" href="class_q_json.html#a62611c70f740caf8cdddd71dcf85ebf0">errorLine</a> </dd></dl>

</div>
</div>
<a class="anchor" id="abcbd4e2d7d22ab5dcc07c7883be8ad72"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QVariant <a class="el" href="class_q_json.html#a9bc6ed3d63283e1c654f42f1906468b1">QJson::parse</a> </td>
          <td>(</td>
          <td class="paramtype">const QUrl&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This is a method provided for convenience. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>to the server page containing the JSON object representation </td></tr>
    <tr><td class="paramname">ok</td><td>if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>a QVariant object generated from the JSON string </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="class_q_json.html#a3386d3a47cf4ca73224aad37e23d28a5">errorString</a> </dd>
<dd>
<a class="el" href="class_q_json.html#a62611c70f740caf8cdddd71dcf85ebf0">errorLine</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="qjson_8h_source.html">qjson.h</a></li>
<li>qjson.cpp</li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Mon Apr 9 2012 23:57:46 for QJson by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
